﻿<!--/* 
* Copyright (c) 2009, The University of Texas at Austin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, 
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, 
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, 
* this list of conditions and the following disclaimer in the documentation and/or other materials 
* provided with the distribution.
*
* Neither the name of The University of Texas at Austin nor the names of its contributors may be 
* used to endorse or promote products derived from this software without specific prior written 
* permission.
* 
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/-->
    
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="CloseButton"  TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
        <Setter Property="Opacity" Value=".75" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center">
                        <Ellipse Fill="{TemplateBinding Background}" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" />
                        <Path Stroke="{TemplateBinding Foreground}" Width="8" Height="8"
                              HorizontalAlignment="Center" VerticalAlignment="Center"
                              Data="M0,0 L8,8 M0,8 L8,0" StrokeThickness="2" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Opacity" Value="1" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="TogglePin" TargetType="ToggleButton">
        <Setter Property="Opacity" Value=".75" />
        <Setter Property="Cursor" Value="Hand" /> 
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid>
                        <Rectangle x:Name="MouseOverFill" Fill="LightGray" Stroke="DarkGray" StrokeThickness="1" Opacity=".75" Visibility="Collapsed" />
                         <Canvas x:Name="isChecked" Visibility="Collapsed" Width="16" Height="16">
                            <Rectangle Stroke="Black" Width="8.694" Height="10.907" Canvas.Left="3.465">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="1.411,0.519" StartPoint="-0.256,0.52">
                                        <GradientStop Color="Black" Offset="0.771"/>
                                        <GradientStop Color="White" Offset="0.438"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Path Stretch="Fill" Stroke="Black" Width="15.816" Height="1" Data="M0,11.754 L14.816147,11.754" Canvas.Top="10.181">
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="1.411,0.519" StartPoint="-0.256,0.52">
                                        <GradientStop Color="Black" Offset="0.771"/>
                                        <GradientStop Color="White" Offset="0.438"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                            <Path Stretch="Fill" Stroke="Black" Width="1" Height="5.545" Data="M8,11.907 L8,16" Canvas.Left="7.274" Canvas.Top="10.455">
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="1.411,0.519" StartPoint="-0.256,0.52">
                                        <GradientStop Color="Black" Offset="0.771"/>
                                        <GradientStop Color="White" Offset="0.438"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                        </Canvas>
                        <Canvas x:Name="notChecked" Visibility="Collapsed" Width="16" Height="16">
                            <Rectangle Stroke="Black" Width="8.694" Height="10.907" RenderTransformOrigin="0.5,0.5" Canvas.Left="6.4" Canvas.Top="2.416">
                                <Rectangle.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform Angle="89.901"/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </Rectangle.RenderTransform>
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="1.411,0.519" StartPoint="-0.256,0.52">
                                        <GradientStop Color="Black" Offset="0.771"/>
                                        <GradientStop Color="White" Offset="0.438"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Path Stretch="Fill" Stroke="Black" Width="1" Height="15.531" Data="M5.0345997,1.0061058 L4.9138399,14.531208" Canvas.Left="4.914">
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="1.411,0.519" StartPoint="-0.256,0.52">
                                        <GradientStop Color="Black" Offset="0.771"/>
                                        <GradientStop Color="White" Offset="0.438"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                            <Path Stretch="Fill" Stroke="Black" HorizontalAlignment="Stretch" Margin="0" Width="6.155" Height="1" Data="M54.5,17.389417 L59.65536,17.389417" Canvas.Top="7.605">
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="1.411,0.519" StartPoint="-0.256,0.52">
                                        <GradientStop Color="Black" Offset="0.771"/>
                                        <GradientStop Color="White" Offset="0.438"/>
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                        </Canvas>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="MouseOverFill" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="isChecked" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter TargetName="notChecked" Property="Visibility" Value="Visible" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Opacity" Value="1" />
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True">
                <Setter Property="Opacity" Value="1" />
            </Trigger>
        </Style.Triggers>
    </Style>


</ResourceDictionary>